//
//  InformationDetailVC.m
//  MRBang
//
//  Created by 铅笔 on 16/5/17.
//  Copyright © 2016年 杭州易网新科技. All rights reserved.
//

#import "InformationDetailVC.h"

@interface InformationDetailVC ()<UIWebViewDelegate>

@property (strong, nonatomic) UIWebView *browseWeb;

@end

@implementation InformationDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];

    //状态栏背景色
    UIView *statusBarView=[[UIView alloc] initWithFrame:CGRectMake(0, 0,kScreenWidth, 20)];
    [self.view addSubview:statusBarView];
    
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO];
    
    self.title = @"资讯详情";
    self.view.backgroundColor = COLOR_EVERYVIEWBG;
    
    self.browseWeb = [[UIWebView alloc] initWithFrame:CGRectMake(0,64, kScreenWidth, kScreenHeight-64)];
    [self.view addSubview:self.browseWeb];
    
    NSURL *url=[NSURL URLWithString:self.str_url];
    [self.browseWeb loadRequest:[NSURLRequest requestWithURL:url]];
    //此处是处理网页黑条条的状况
    self.browseWeb.opaque = NO;
    self.browseWeb.backgroundColor = [UIColor clearColor];
    [self.browseWeb setScalesPageToFit:NO];
    self.browseWeb.delegate = self;
}

- (void) viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.tabBarController.tabBar.hidden = YES;
}

- (void) viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    self.tabBarController.tabBar.hidden = NO;
}


#pragma mark 设置UIWebView
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{

    return YES;
    
}

- (void)webViewDidStartLoad:(UIWebView *)webView
{
    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [MBProgressHUD hideAllHUDsForView:self.view animated:YES];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
   
}

@end
